package com.example.food_contract_system.controller;

import com.example.food_contract_system.service.AgencyService;
import com.example.food_contract_system.service.StatusService;
import com.example.food_contract_system.util.R;
import com.example.food_contract_system.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author LiHaoyang
 * @date 2023/7/7  10:53
 **/
@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private AgencyService agencyService;

    @Autowired
    private StatusService statusService;

    /**
     * 登录 请求方法
     * @param loginVo
     * @return
     */
    @PostMapping("/login")
    public R login(@RequestBody LoginVo loginVo){
        R result = agencyService.login(loginVo);
        return result;
    }

    /**
     * 获取 目前所有的权限角色
     * @return
     */
    @GetMapping("/getUserStatus")
    public R getUserStatus(){
        R result = statusService.getUserStatus();
        return result;
    }

}
